<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Global Body Planner: include/global_body_planner/graph_class.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Global Body Planner
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_94ddb28d1a8f6d812dff56d903a1ce15.html">global_body_planner</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">graph_class.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef GRAPHCLASS_H</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define GRAPHCLASS_H</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;algorithm&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;unordered_map&gt;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;unordered_set&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;global_body_planner/planning_utils.h&quot;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespaceplanning__utils.html">planning_utils</a>;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="classGraphClass.html">   21</a></span>&#160;<span class="keyword">class </span><a class="code" href="classGraphClass.html">GraphClass</a></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;{</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;  <span class="keyword">public</span>:</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    <a class="code" href="classGraphClass.html">GraphClass</a>();</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    ~<a class="code" href="classGraphClass.html">GraphClass</a>();</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    <span class="keywordtype">void</span> addVertex(<span class="keywordtype">int</span> index, State s);</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    State getVertex(<span class="keywordtype">int</span> index);</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    </div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keywordtype">int</span> getNumVertices();</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    </div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> addEdge(<span class="keywordtype">int</span> idx1, <span class="keywordtype">int</span> idx2);</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    </div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="keywordtype">void</span> removeEdge(<span class="keywordtype">int</span> idx1, <span class="keywordtype">int</span> idx2);</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    </div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">int</span> getPredecessor(<span class="keywordtype">int</span> idx);</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    </div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    std::vector&lt;int&gt; getSuccessors(<span class="keywordtype">int</span> idx);</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    </div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keywordtype">void</span> addAction(<span class="keywordtype">int</span> idx, Action a);</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    </div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    Action getAction(<span class="keywordtype">int</span> idx);</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    </div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="keywordtype">void</span> updateGValue(<span class="keywordtype">int</span> idx, <span class="keywordtype">double</span> val);</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <span class="keywordtype">double</span> getGValue(<span class="keywordtype">int</span> idx);</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="keywordtype">void</span> printVertex(State s);</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    </div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="keywordtype">void</span> printVertices();</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    </div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="keywordtype">void</span> printIncomingEdges(<span class="keywordtype">int</span> idx);</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    </div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> printEdges();</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> init(State s);</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;  <span class="keyword">protected</span>:</div><div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="classGraphClass.html#a4ce5071e5d6f7f58965d0babf0c05cba">  142</a></span>&#160;    std::unordered_map&lt;int, State &gt; <a class="code" href="classGraphClass.html#a4ce5071e5d6f7f58965d0babf0c05cba">vertices</a>;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div><div class="line"><a name="l00145"></a><span class="lineno"><a class="line" href="classGraphClass.html#af72e4666fa9283cd4c3d4acfccbcfd57">  145</a></span>&#160;    std::unordered_map&lt;int, Action &gt; <a class="code" href="classGraphClass.html#af72e4666fa9283cd4c3d4acfccbcfd57">actions</a>;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div><div class="line"><a name="l00148"></a><span class="lineno"><a class="line" href="classGraphClass.html#ab931f0784548afda6c934ac3b097cebd">  148</a></span>&#160;    std::unordered_map&lt;int, std::vector&lt;int&gt; &gt; <a class="code" href="classGraphClass.html#ab931f0784548afda6c934ac3b097cebd">edges</a>;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno"><a class="line" href="classGraphClass.html#a2e6c5c4d16682dafe430d71b0f8678a5">  151</a></span>&#160;    std::unordered_map&lt;int, std::vector&lt;int&gt; &gt; <a class="code" href="classGraphClass.html#a2e6c5c4d16682dafe430d71b0f8678a5">successors</a>;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;</div><div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="classGraphClass.html#a75a6a398215073b3e67b852cc136bd53">  154</a></span>&#160;    std::unordered_map&lt;int, double&gt; <a class="code" href="classGraphClass.html#a75a6a398215073b3e67b852cc136bd53">g_values</a>;</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;};</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="namespaceplanning__utils_html"><div class="ttname"><a href="namespaceplanning__utils.html">planning_utils</a></div><div class="ttdef"><b>Definition:</b> planning_utils.h:18</div></div>
<div class="ttc" id="classGraphClass_html"><div class="ttname"><a href="classGraphClass.html">GraphClass</a></div><div class="ttdoc">A general directed graph class. </div><div class="ttdef"><b>Definition:</b> graph_class.h:21</div></div>
<div class="ttc" id="classGraphClass_html_af72e4666fa9283cd4c3d4acfccbcfd57"><div class="ttname"><a href="classGraphClass.html#af72e4666fa9283cd4c3d4acfccbcfd57">GraphClass::actions</a></div><div class="ttdeci">std::unordered_map&lt; int, Action &gt; actions</div><div class="ttdoc">Map from vertex indices to the actions leading to those vertices. </div><div class="ttdef"><b>Definition:</b> graph_class.h:145</div></div>
<div class="ttc" id="classGraphClass_html_a2e6c5c4d16682dafe430d71b0f8678a5"><div class="ttname"><a href="classGraphClass.html#a2e6c5c4d16682dafe430d71b0f8678a5">GraphClass::successors</a></div><div class="ttdeci">std::unordered_map&lt; int, std::vector&lt; int &gt; &gt; successors</div><div class="ttdoc">Map from vertex indices to their children. </div><div class="ttdef"><b>Definition:</b> graph_class.h:151</div></div>
<div class="ttc" id="classGraphClass_html_a75a6a398215073b3e67b852cc136bd53"><div class="ttname"><a href="classGraphClass.html#a75a6a398215073b3e67b852cc136bd53">GraphClass::g_values</a></div><div class="ttdeci">std::unordered_map&lt; int, double &gt; g_values</div><div class="ttdoc">Map from vertex indices to their costs (g-values) </div><div class="ttdef"><b>Definition:</b> graph_class.h:154</div></div>
<div class="ttc" id="classGraphClass_html_ab931f0784548afda6c934ac3b097cebd"><div class="ttname"><a href="classGraphClass.html#ab931f0784548afda6c934ac3b097cebd">GraphClass::edges</a></div><div class="ttdeci">std::unordered_map&lt; int, std::vector&lt; int &gt; &gt; edges</div><div class="ttdoc">Map from vertex indices to their parent(s) </div><div class="ttdef"><b>Definition:</b> graph_class.h:148</div></div>
<div class="ttc" id="classGraphClass_html_a4ce5071e5d6f7f58965d0babf0c05cba"><div class="ttname"><a href="classGraphClass.html#a4ce5071e5d6f7f58965d0babf0c05cba">GraphClass::vertices</a></div><div class="ttdeci">std::unordered_map&lt; int, State &gt; vertices</div><div class="ttdoc">Map from vertex indices to corresponding states. </div><div class="ttdef"><b>Definition:</b> graph_class.h:142</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
